

********************************************* REPLICATION CODE: ANALYSIS FOR "WHAT STYMIES ACTION ON CLIMATE CHANGE?" BY HONIG, SMITH, AND BLECK
********************************************* SUBMISSION FOR PERSPECTIVES ON POLITICS
********************************************* Analysis by Amy Erica Smith, amyericas@gmail.com

*** USE kenya afrobarometer R7, which may be downloaded from: http://afrobarometer.org/data
use "ken_r7_data.dta", clear


****************************************************** INDEPENDENT VARIABLES ********************************************************************
***************************religion codings 
**“None”: None, Agnostic, Atheist
recode Q98 (0 28 29  . -1 = 1) (9998 9999 = .) (else = 0), g(None)
	label var None "Q98: None, Agnostic, Atheist"
**“Catholic”: Roman Catholic
recode Q98 (2=1) (. -1 = .) (9998 9999 = .) (else = 0), g(Cath)
	label var Cath "Q98 Catholic"
**“Protestant/Evangelical”: ,Mennonite Anglican, Lutheran, Methodist, Presbyterian, Baptist, Quaker/Friends, Evangelical, Seventh Day Adventist, Dutch Reformed, Calvinist, Church of Christ,
recode Q98 (5 6 7 8 9 10 11 12 16 31 32 30 = 1) (9998 9999 = .) (. -1 = .) (else = 0), g(Prot)
	label var Prot "Q98: Anglican, Menn, Lutheran, Methodist, Presbyterian, Baptist, Quaker/Friends, Evangelical, SDA, Dutch Reform, Calvinist, Church of Christ"
***Anglican
recode Q98 (5 = 1) (9998 9999 = .) (. -1 = .) (else = 0), g(Anglican)
	label var Anglican "Q98: Anglican; note also part of Prot"
**“Pentecostal, AIC, and Other Christian”: Pentecostal, “Independent”, Zionist Christian Church, “Christian only”, Orthodox, Coptic, Jehovah's Witness, Mormon, 
recode Q98 (1 3 4 13 15 17 33 14 9995 = 1) (9998 9999 = .) (. -1 = .) (else = 0), g(PentOther)
	// ** it turns out ALL the "other" mentions are Pentecostal/Independent churches. See:
	tab1 Q98OTHER
label var Pent "Q98 Pentecostal, Independent, Other Christian Churches"
**“Muslim”: Muslim only, Sunni only, Shia only
recode Q98 (18 19 24 = 1) (9998 9999 = .) (. -1 = .) (else = 0), g(Musl)
	label var Musl "Q98 Muslim, Sunni only, Shia only"
**“Other”: Traditional/ethnic religion, Hindu, Bahai, Other
recode Q98 (25 26 27 = 1) (9998 9999 = .) (. -1 = .) (else = 0), g(OTHERrel)
	label var OTHERrel "Q98:Traditional/ethnic religion, Hindu, Bahai, Other" 
	*** it turns out there are only 3 of these people, once we code the people who said "other" as Pentecostals
	
***** create a single variable for all religions
egen religiousID = group(Musl PentOther Prot Cath None) if OTHERrel != 1
	lab def religiousID 1 "None" 2 "Catholic" 3 "Protestant" 4 "Pentecostal, Independent, & Other Christian" 5 "Muslim" 
	lab val religiousID religiousID
	lab var religiousID "Religious Identification"
recode religiousID (1 = 1) (2 3 4 = 2) (5=3), g(religion)
	lab def religion 1 "None" 2 "Christian" 3 "Muslim"
	lab val religion religion
	
	
*************************** trust and group attitudes
***** trust in religious leaders
g religioustrust = (Q43K/3) if Q43K < 8
	lab var religioustrust "Trust in Religious Leaders"
recode religioustrust (0/.7 = 0) (1=1), g(highreltrust)
 
***create state trust variable (trust: president, parliament, county govt, courts) Other vars not included ///
***(electoral commission, elected councillors, ruling party, opposition party, police, army)
recode Q43A Q43B Q43E1_KEN Q43I (-1 8 9 = .)
factor Q43A Q43B Q43E1_KEN Q43I
egen statetrust = rowmean(Q43A Q43B Q43E1_KEN Q43I)
	replace statetrust = statetrust/3
	label var statetrust "Trust in State"
	recode statetrust (0/.7 = 0) (.71/1=1), g(highstatetrust)
 
***create gap in trust variable
gen trustgap=religioustrust-statetrust 
label var trustgap "Trust Gap (Religious Leaders v. State)"
 
***Ability to access information from the state 
recode Q18* (-1 8 9  = .)
alpha Q18*
egen infoaccess = rowmean(Q18*)
replace infoaccess = infoaccess/3
 
 
***ethnicgrievance
recode Q85A (-1 7 8 9 = 0), g(ethnicgrievance)
replace ethnicgrievance = ethnicgrievance/3
lab var ethnicgrievance "Ethnic Grievances"

*** kenyan v ethnic ID
recode Q85B (-1 7 8 9 = .) , g(kenyan_v_ethnicID)
replace kenyan_v_ethnicID = (kenyan_v_ethnicID -1)/4
lab var kenyan_v_ethnicID "Kenyan v. Ethnic ID"

*** discrimination
recode Q86AD (-1 8 9 = 0), g(ethnicdiscrimination)
replace ethnicdiscrimination = ethnicdiscrimination/3

egen grievance2 = rowmean(ethnicgrievance ethnicdiscrimination) 
 
*************************** demographics
***Male
gen Male=Q101
recode Male 2=0
label var Male "Male"

 **rural/urban
 gen Urban=urbrur
 recode Urban 2=0
 
**education
gen Secondary=0
replace Secondary=1 if Q97==5
replace Secondary=. if Q97==-1
replace Secondary=. if Q97==98
replace Secondary=. if Q97==99
replace Secondary=1 if Q97>5
label var Secondary "Q97: Completed secondary and beyond"

gen Education =Q97
	replace Education=. if Q97==-1
	replace Education=. if Q97==98
	replace Education=. if Q97==99
	label var Education "Education"
 
gen NoSchool=Education
replace NoSchool=77 if Education==0
replace NoSchool=0 if Education>0
recode NoSchool 77=1
 
label var NoSchool "Q97: No formal schooling"
 
**youth
gen Youth=Q1
replace Youth=0 if Q1>35
replace Youth=. if Q1==999
replace Youth=1 if Q1>17 & Q1<36
label var Youth "Q1: HH 35 or under"


gen Age=Q1
replace Age=. if Q1==998
replace Age=. if Q1==999
replace Age=. if Q1==-1
label var Age "Age"


**no food
gen Hunger=Q8A
replace Hunger =. if Q8A==-1
replace Hunger =. if Q8A==8
replace Hunger =. if Q8A==9
label var Hunger "Food shortage frequency"

**ethnicity
recode Q84 (-1 9995 9998 = .)
recode Q84 (307=1) (else = 0), g(masai)
	lab var masai "Masai/Samburu"
recode Q84 (310=1) (else = 0), g(somali)
	lab var somali "Somali"
recode Q84 (307 310 312 311 = 1) (else = 0), g(pastoralists)
	lab var pastoralists "Pastoralist"
	recode pastoralists (1=0) if Urban == 1

** difficulty answering questions	
g difficulty = Q108/4
	lab var difficulty "Difficulty Answering Questions"

********************************************** CLIMATE CHANGE ATTITUDES *****************************************************************

************** salience of climate change: Climate worsening?
recode Q72 (-1=.) (1 2 = 2) (3 = 1) (4 5 = 0) (9=.), g(climateperception)
	lab def climateperception 2 "Worse" 1 "Same" 0 "Better"
	lab val climateperception climateperception
recode climateperception (2=1) (1 0 = 0), g(climateworsening)
	lab var climateworsening "Climate Worsening"

************** salience of climate change: "Most Important Problem"
*Farming/Agriculture: Option 7
*Food Shortage/Famine: 8
*Drought: 9
*Water supply: 17
g mip_1st = Q55PT1 == 7 | Q55PT1 == 8 | Q55PT1 == 9 | Q55PT1 == 17 
	g mip_2nd = Q55PT2 == 7 | Q55PT2 == 8 | Q55PT2 == 9 | Q55PT2 == 17 
	g mip_3rd = Q55PT3 == 7 | Q55PT3 == 8 | Q55PT3 == 9 | Q55PT3 == 17 
g mip_any = mip_1st == 1 | mip_2nd == 1 | mip_3rd == 1 

g mipr_1st = Q55PT1 == 8 | Q55PT1 == 9 | Q55PT1 == 17 
	g mipr_2nd = Q55PT2 == 8 | Q55PT2 == 9 | Q55PT2 == 17 
	g mipr_3rd = Q55PT3 == 8 | Q55PT3 == 9 | Q55PT3 == 17 
g mipr_any = mipr_1st == 1 | mipr_2nd == 1 | mipr_3rd == 1 


************** Efficacy: Can ordinary people do something?
recode Q78 (1=0) (2 3 = 1) (-1 0 7 8 9 . = .), g(CollectiveA)
	label var CollectiveA "Binary of Q78: Ordinary Kenyans can do something (little&alot)"
	label define CollectiveALL 0 "Ordinary Kenyans can do nothing at all" 1 "Ordinary Kenyans can do a little or a lot" 
	label values CollectiveA CollectiveALL

recode Q78 (1=0) (2=1) (3=2) (-1 0 7 8 9 . = .), g(CollectiveA_2)
	label var CollectiveA_2 "Q78: Ordinary Kenyans can do nothing, a little, a lot"
	label define CollectiveAl 0 "Ordinary Kenyans can do nothing at all" 1 "Ordinary Kenyans can do a little bit" 2 " Ordinary Kenyans can do a lot"
	label values CollectiveA_2 CollectiveAl

recode Q78 (1=1) (2 3 = 0) (-1 0 7 8 9 . = .), g(kenyanscandonothing)
recode Q78 (1 2 =0) (3 = 1) (-1 0 7 8 9 . = .), g(kenyanscandoalot)
	
	
************** BELIEF IN ANTHROPOGENIC CLIMATE CHANGE
**x Q75. Climate change: main cause 
gen MainCause=Q75
	replace MainCause=. if Q75== -1 | Q75== 7 | Q75== 8 | Q75== 9 | Q75== .
	label define MainCauseL 1 "Human Activity" 2 "Natural Processes" 3 "Both Human Activity and Natural Processes" 4 "None of these"
	label values MainCause MainCauseL
gen HumanA=0
	replace HumanA=1 if Q75==1
	replace HumanA=. if Q75== -1 | Q75== 7 | Q75== 8 | Q75== 9 | Q75== .
	label var HumanA "Believes in only human activity as cause"
gen BothHumanA=HumanA
	replace BothHumanA =1 if MainCause==3
	label var BothHumanA "Q75: dummy for any belief in human agency"


****************************** Selection variables: who got the efficacy question?
recode Q73 (-1 9 = 0), g(HeardCC)
	label var HeardCC "Has heard of climate change"

recode Q78 (1 2 3=1) (0 -1 9 . = 0) (7 = .), g(StopCC)
	label define StopCC 0 "Heard of CC, but doesn't need to be stopped" 1 "Heard of CC, CC does need to be stopped"
	recode StopCC 0 = . if HeardCC == 0

recode CollectiveA_2 (0 1 2 = 1) (. = 0), g(got_efficacy_q)
	


**************************************************************************************************************************************************************************************
********************************************************************************** RESULTS *******************************************************************************************
************ In text discussion of efficacy ************************************************************************
mean kenyanscandonothing [pweight= withinwt]
mean kenyanscandoalot [pweight= withinwt]


************ Figure 1: Efficacy (from multivariate analysis) ***************************************************************************
global indvars Education Age Urban Hunger Male masai somali pastoralists i.region 
global modelspecs [pweight= withinwt], cluster(region)
preserve
	ologit CollectiveA_2 b5.religion  $indvars $modelspecs
		margins religion, post level(76)
		parmest, label norestore level(76)
egen dv = seq(), f(1) t(3) block(3)
	drop if dv == 2
	recode dv (3=2)
	lab def dv 1 "Kenyans Can Do Nothing" 2 "Kenyans Can Do a Lot", modify
	lab val dv dv
egen religion = seq(), f(1) t(3)
	lab def religion 1 "None" 2 "Christian" 3 "Muslim", modify
	lab val religion religion
g xaxis = _n + (dv-1)
graph twoway (bar estimate xaxis if religion == 1, lcolor(black) fcolor(gs5) barwidth(0.8)) ///
			(bar estimate xaxis if religion == 2, lcolor(black) fcolor(gs10) barwidth(0.8)) ///
			(bar estimate xaxis if religion == 3, lcolor(black) fcolor(gs15) barwidth(0.8)) ///
			(rspike min76 max76 xaxis, lcolor(gs10)) , ///
	graphregion(lcolor(black) fcolor(white)) ytitle("Predicted Probability of Saying Kenyans Can Do:", margin(small)) yscale(r(0)) ///
	xlabel(2 "Nothing" 6 "A Lot", notick) xtitle("") legend(order(1 "None" 2 "Christian" 3 "Muslim") col(3) symxsize(10) span)
restore


************ In text discussion of issue salience ************************************************************************
mean climateworsening [pweight= withinwt]
mean mip_any [pweight= withinwt]
mean mip_1st [pweight= withinwt]


*********** in-text discussion of predicted probs when issue salience is added to efficacy model ************************************************************************
ologit CollectiveA_2 3.religion ethnicgrievance kenyan_v_ethnicID climateworsening $indvars $modelspecs
	margins religion
	
	
******************************* Table 1: Determinants of Efficacy ************************************************************************
global indvars masai somali pastoralists i.region Education Age Urban Hunger Male 
global modelspecs [pweight= withinwt], cluster(region)
eststo clear
ologit CollectiveA_2 3.religion $indvars $modelspecs
	eststo
ologit CollectiveA_2 3.religion climateworsening $indvars $modelspecs
	eststo
ologit CollectiveA_2 3.religion climateworsening BothHumanA $indvars $modelspecs
	eststo
ologit CollectiveA_2 c.statetrust##3.religion climateworsening BothHumanA $indvars $modelspecs
	eststo
ologit CollectiveA_2 c.trustgap##3.religion climateworsening BothHumanA $indvars $modelspecs
	eststo
esttab, replace b(3) se(3) label star(* .10 ** .05 *** .01) nogaps nomtitles nodepvars nopar
*esttab using Table1, tex replace b(3) se(3) label star(* .10 ** .05 *** .01) nogaps nomtitles nodepvars


***** in text discussion: causes of climate change ************************************************************************
*HumanA = Only anthropogenic
*BothHumanA = Anthropogenic + natural causes
mean HumanA [pweight= withinwt]
mean BothHumanA [pweight= withinwt]


****** in text discussion: predicted probabilities ************************************************************************
global indvars masai somali pastoralists i.region Education Age Urban Hunger Male 
global modelspecs [pweight= withinwt], cluster(region)
ologit CollectiveA_2 c.statetrust##Musl climateworsening BothHumanA $indvars $modelspecs
	margins, at(Musl=(0 1) statetrust=(0(.2)1) ) 
ologit CollectiveA_2 c.trustgap##Musl climateworsening BothHumanA $indvars $modelspecs
	margins, at(Musl=(1) trustgap=(-1(.25)1) ) 


******************************* Figure 2 ************************************************************************
global indvars masai somali pastoralists i.region Education Age Urban Hunger Male 
global modelspecs [pweight= withinwt], cluster(region)
ologit CollectiveA_2 c.statetrust##Musl climateworsening BothHumanA $indvars $modelspecs
preserve
	margins, at(Musl=(0 1) statetrust=(0(.2)1) ) post 
	parmest, label norestore 
	egen muslim = seq(), f(0) t(1)
		lab def muslim 0 "Non-Muslims" 1 "Muslims"
		lab val muslim muslim
	egen religioustrust = seq(), f(0) t(5) block(2)
		replace religioustrust = religioustrust/5
	egen outcome = seq(), f(1) t(3) block(12)
	graph twoway (rcap min95 max95 religioustrust if outcome != 2, lcolor(gs10)) ///
			 (connected estimate religioustrust if outcome == 1, lcolor(gs5) mcolor(gs5) msymbol(D)) ///
			 (connected estimate religioustrust if outcome == 3, lcolor(gs10) lwidth(thick) lpattern(dash_dot) mcolor(gs10) msymbol(O)), ///
		by(muslim, graphregion(fcolor(white) lcolor(black)) note(" ")  		)	///
		ytitle("Predicted Agency Beliefs") xtitle("Trust in State Leaders") xlabel(0 "None" 1 "A lot") yscale(r(0 1)) ///
		legend(order(2 "Can do nothing" 3 "Can do a lot")) ylabel(0(.2)1)
restore

******************************* Figure 3 ************************************************************************
global indvars masai somali pastoralists i.region Education Age Urban Hunger Male 
global modelspecs [pweight= withinwt], cluster(region)
ologit CollectiveA_2 c.trustgap##Musl climateworsening BothHumanA $indvars $modelspecs
preserve
	margins, at(Musl=(0 1) trustgap=(-1(.25)1) ) post 
	parmest, label norestore 
	egen muslim = seq(), f(0) t(1) 
		lab def muslim 0 "Non-Muslims" 1 "Muslims"
		lab val muslim muslim
	egen trustgap = seq(), f(0) t(8) block(2)
		replace trustgap = (trustgap/4)-1
	egen outcome = seq(), f(1) t(3) block(18)
	graph twoway (rcap min95 max95 trustgap if outcome != 2, lcolor(gs10)) ///
			 (connected estimate trustgap if outcome == 1, lcolor(gs5) mcolor(gs5) msymbol(D)) ///
			 (connected estimate trustgap if outcome == 3, lcolor(gs10) lwidth(thick) lpattern(dash_dot) mcolor(gs10) msymbol(O)), ///
		by(muslim, graphregion(fcolor(white) lcolor(black)) note(" ")  		)	///
		ytitle("Predicted Agency Beliefs") xtitle("Gap in Trust")  xlabel(-1 "State > Religious" 0 "Equal Trust" 1 "Religious > State") xscale(r(-1.15 1.15)) ///
		legend(order(2 "Can do nothing" 3 "Can do a lot")) ylabel(0(.2)1) yscale(r(0 1)) xsize(6.5)
restore
		

**************************************************************************************************************************************************************************************
********************************************************************************** APPENDIX *******************************************************************************************

************* Appendix Table 1: Who gets the question about environmental efficacy?
global indvars Education Age Urban Hunger Male masai somali pastoralists i.region 
global modelspecs [pweight= withinwt], cluster(region)


************ Appendix Table 2: More exploration of ethnicity
tab Q84 Musl
global indvars pastoralists i.region Education Age Urban Hunger Male 
global modelspecs [pweight= withinwt], cluster(region)
eststo clear
ologit CollectiveA_2 3.religion i.Q84 $indvars $modelspecs
	eststo
ologit CollectiveA_2 3.religion ethnicgrievance $indvars $modelspecs
	eststo
ologit CollectiveA_2 3.religion kenyan_v_ethnicID $indvars $modelspecs
	eststo
esttab using AppTable_eff, tex replace b(3) se(3) label star(* .10 ** .05 *** .01) nogaps nomtitles nodepvars
	


************ Appendix Table 3: Issue Salience (with Controls) ****************************************************************
global indvars 5.religiousID Education Age Urban Hunger Male masai somali pastoralists i.region 
global modelspecs [pweight= withinwt], cluster(region)
eststo clear
ologit climateperception $indvars $modelspecs
	eststo
logit mip_1st $indvars $modelspecs
	eststo
logit mip_any $indvars $modelspecs
	eststo
esttab using AppTable_salience, tex replace b(3) se(3) label star(* .10 ** .05 *** .01) nogaps nomtitles nodepvars


*********** Appendix Table 4: What causes climate change? *************************************************************
global indvars i.religion Education Age Urban Hunger Male masai somali pastoralists i.region 
global modelspecs [pweight= withinwt], cluster(region)
eststo clear
logit HumanA $indvars $modelspecs
	eststo
logit BothHumanA $indvars $modelspecs
	eststo
esttab using AppTable_anthropo, tex replace b(3) se(3) label star(* .10 ** .05 *** .01) nogaps nomtitles nodepvars


******************************* Appendix Table 5: Religious Trust Model		
global indvars masai somali pastoralists i.region Education Age Urban Hunger Male 
global modelspecs [pweight= withinwt], cluster(region)
eststo clear
ologit CollectiveA_2 c.religioustrust##3.religion climateworsening BothHumanA $indvars $modelspecs
	eststo
ologit CollectiveA_2 c.religioustrust##3.religion c.statetrust##3.religion climateworsening BothHumanA $indvars $modelspecs
	eststo
ologit CollectiveA_2 religioustrust statetrust i.region if religiousID == 5 $modelspecs 
	eststo
ologit CollectiveA_2 religioustrust statetrust ethnicgrievance kenyan_v_ethnicID climateworsening BothHumanA $indvars if religiousID == 5 $modelspecs
	eststo
esttab using AppTable_religtrust, tex replace b(3) se(3) label star(* .10 ** .05 *** .01) nogaps nomtitles nodepvars


******************************* Appendix Table 6: Alternative Measures to State Trust
global indvars masai somali pastoralists i.region Education Age Urban Hunger Male 
global modelspecs [pweight= withinwt], cluster(region)
eststo clear
ologit CollectiveA_2 c.infoaccess##Musl climateworsening BothHumanA $indvars $modelspecs
	eststo
esttab, b(3) se(3) label star(* .10 ** .05 *** .01) wide nopar

	

